import Vue from 'vue'
import store from '../store'
import ajax from '../utils/ajax'

Vue.prototype.$ajax = ajax
store.$ajax = ajax

uni.getNetworkType({
  success({
    networkType
  }) {
    store.commit('event/setNetWorkType', networkType)
  }
})

uni.onNetworkStatusChange(({
  networkType
}) => {
  store.commit('event/setNetWorkType', networkType)
})
